﻿@model Hotel.Web.Models.Assignment
@{
    ViewBag.Title = Hotel.Web.Views.Assignment.AssignmentResources.Assignment;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@Hotel.Web.Views.Assignment.AssignmentResources.Greeting</h2>
@Html.ValidationSummary(true, Hotel.Web.Views.Assignment.AssignmentResources.ErrorSummary)
@using (Html.BeginForm())
{
    <fieldset>
        <legend>@Hotel.Web.Views.Assignment.AssignmentResources.NewTask</legend>
        <br />
        <div class="fl">
            @Html.LabelFor(model => model.RoomNumber)
            @Html.EditorFor(model => model.RoomNumber)
            @Html.ValidationMessageFor(model => model.RoomNumber)<br />
            @Html.LabelFor(model => model.CurrentService.Name)<br />
            @{
    using (Hotel.Module.Resources.HotelResourcesController m_ResourcesController = Hotel.Web.Helpers.ServiceLocator.Instance.GetService(typeof(Hotel.Module.Resources.IResourseManagment)) as Hotel.Module.Resources.HotelResourcesController)
    {
        List<Hotel.Module.Resources.Models.Service> list = m_ResourcesController.GetAllServices(Hotel.Module.Resources.Models.ServiceType.Rated);
        List<string> serviceNames = new List<string>();
        foreach (var service in list)
        { serviceNames.Add(service.Name); }
                @Html.DropDownListFor(model => model.CurrentService.Name, new SelectList(serviceNames))
    }
            }
            <p>
                @Html.ActionLink(Hotel.Web.Views.Assignment.AssignmentResources.NewService, "NewService")
            </p>
            @Html.LabelFor(model => model.Description)
            @Html.TextAreaFor(model => model.Description, new { style = "width: 200px" })
            @Html.ValidationMessageFor(model => model.Description)
            @Html.LabelFor(model => model.WorkerType)<br />
            @Html.DropDownList("WorkerType", new SelectList(Enum.GetValues(typeof(Hotel.Web.Models.Assignment.CurrentWorkerType))))
            <br />
        </div>
        <br />
        <br />
        <input type="submit" value= "@Hotel.Web.Views.Assignment.AssignmentResources.Create"/>
    </fieldset>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}